package com.aaa.hospital.service.impl;

import com.aaa.hospital.mapper.LoginMapper;
import com.aaa.hospital.pojo.domain.Emp;
import com.aaa.hospital.pojo.domain.Login;
import com.aaa.hospital.result.AjaxResult;
import com.aaa.hospital.service.InfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: danghui
 * @Date: 2022/2/23 9:41
 * @Description: TODO
 */
@Service
public class InfoServiceImpl implements InfoService {

    @Autowired
    private LoginMapper loginMapper;

    @Override
    public AjaxResult listInfo(Emp emp) {
        List<Emp> emps = loginMapper.listInfo(emp);
        return AjaxResult.success(emps);
    }

    @Override
    public AjaxResult addAccount(Login login) {
        int i = loginMapper.addAccount(login);
        if (i>0){
            return AjaxResult.success();
        }else {
            return AjaxResult.fail();
        }
    }
}
